<?php
/**
 * article actions.
 *
 * @package    Nika
 * @subpackage article
 * @author     Alexey Shapran (alexey.shapran@gmail.com)
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class articleActions extends sfActions
{

	public function executeIndex(sfWebRequest $request)
	{       
	    // init PAGER
	    $this->pager = new sfDoctrinePager('article', sfConfig::get('app_maxarticleperpage'));
	    $this->pager->setQuery(Article::Showsomearticles());
	    $this->pager->setPage($request->getParameter('page','1'));
	    $this->pager->init();
	    
	}

	public function executeView(sfWebRequest $request)
	{
		$this->article = $this->getRoute()->getObject();
		$this->forward404Unless($this->article);
		$response = $this->getResponse();
	
	$response->addMeta('keywords', $this->article['keywords']);
	$response->addMeta('description', $this->article['description']);
	$response->setTitle(sfConfig::get('app_title')." | ".$this->article['title']);
	
	}
  
}
